<?
session_start();

require_once('config.php');
require_once('class/cls_product.php');
require_once('right.php');
require_once('class/cls_sales.php');
require_once('class/cls_coordinator.php');
require_once('class/cls_customer.php');


$coordinator    = new cls_coordinator();
$product		= new cls_product();
$sales			= new cls_sales();
$right 			= new right();
$customer       = new cls_customer();

$coordinator_id		= $_REQUEST['coordinator_id'];

if (isset($_POST['firstname']))
		{
			$objpost	= $_POST;
			//output_array($objpost);
			if (strlen(trim($_POST['firstname'])) == 0) {
				$errfirstname	= "Insert First Name!";
				$chkSave 	= false;}
			if (strlen(trim($_POST['lastname'])) == 0) {
				$errlastname = "Insert Last Name!";
				$chkSave = false;}
			if (strlen(trim($_POST['email'])) == 0) {
				$erremail = "Insert Your Email!";
				$chkSave = false;}
			 if (strlen((trim($_POST['email'])))>0){
				// the user's email cannot be a null string
				$validEmailExpr =
				"^[0-9a-z~!#$%&_-]([.]?[0-9a-z~!#$%&_-])*" .
				"@[0-9a-z~!#$%&_-]([.]?[0-9a-z~!#$%&_-])*$";
			if (!eregi($validEmailExpr, $_POST['email'])){
				// The email must match the above regular expression
				$erremail = "The email must be in the name@domain format.";
				$chkSave = false;}//ereg
			elseif (strlen(trim($_POST['email'])) > 50){
				// The length cannot exceed 50 characters
				$erremail = "The email can be no longer than 50 characters.";
				$chkSave = false;}//email length
				}//email if

			$chkSave = (isset($chkSave)) ? false : true;

			if ($chkSave == true)
			{
				
					$objpost['date']		= render_date($objpost['date'],DBDATEFORMAT);
					
					$customer->insert_customer($objpost);
					session_destroy();
					unset($_SESSION['id']);
					header ("Location: success
					.php");
			}			

		   
		}//if post

?>
<html>
<head>

<title>Always New Fashion</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="bg_sty.css" rel="stylesheet" type="text/css">

<link href="um_sty.css" rel="stylesheet" type="text/css">

<script language="javascript" src="datelib.js"></script>

<script language="JavaScript">
function open_calendar(obj)
{
	//document.calendar.dateout.value = "a";
	new_window=window.open("calendar.php?form=calendar&field=" + obj,"","top=50,left=400,width=575,height=140,menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no");
}
</script>

<style type="text/css">
<!--
.style2 {color: #000000}
.style15 {
	font-size: 18px;
	color: #F49D1B;
}
.style17 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	color: #CF810A;
}
.style22 {
	color: #1C1C79;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style23 {
	font-size: 24px;
	color: #0A1C7E;
	font-weight: bold;
	font-family: Tahoma, Arial, Verdana;
}
.style25 {font-family: Geneva, Arial, Helvetica, sans-serif; color: #CF810A; font-weight: bold; }
.style9 {color: #FF9933;
	font-weight: bold;
}
-->
</style></head>



<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#F7F9F0">



<table id="Table_01" width="760" border="0" cellpadding="0" cellspacing="0" align="center">

	<tr>

		<td>

<div align="center">

<table id="Table_01" width="760" height="80" border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td width="233" height="32"><img src="images/banner.jpg" width="771" height="100" alt=""></td>

		
	</tr>

	

	<tr>

		<td width="400" height="30" bgcolor="#f49d1b"></td>

	</tr>

</table>

</div>

<div align="center">

<table id="Table_02" width="769" height="24" align="center" bgcolor="#000000" border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td width="533" align="left" valign="middle">

		&nbsp;&nbsp;<a  href="index.php" class="ummenu" >Home</a>		

		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		<a href="customer_service.php" class="ummenu">Customer Services</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="contact_us.php" class="ummenu">Contact Us</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="aboutus.php" class="ummenu">About Us</a>

		

		&nbsp;&nbsp;&nbsp;&nbsp;</td>

		<td width="236" height="24" align="right" valign="middle"><a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ja&trurl=http%3a%2f%2fwww.umgroups.com">

		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_zt&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ko&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	</tr>

</table>

</div>

</td>

	</tr>

	<tr>
	  <td>

			<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC" align="center">

				<tr><td colspan="7" height="20"></td>

				</tr>

				<tr>

					<td width="5" ></td>

					<td width="154" rowspan="2" valign="top" class="qcontact" style="padding-left: 4px; padding-top: 50px;"><div align="left"> 

					  <table id="table1" align="center" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0">

<?
		
		//echo "jjj".$_SESSION['username'];
  		$object = $coordinator->get_coordinator();
		//echo "<pre>";
		//print_r ($object);
		//echo "</pre>";
		if (count($object) > 0)
		{
			foreach ($object as $row) {
?>

				<tr>

					<td width="40" height="28">

					<img src="main-img/<?= $row['coordinator_id'].".jpg" ?>" width="40" height="28"></td>

					<td height="28">

					<div class="introLinks">

						<a href="um_products.php?coordinator_id=<?= $row['coordinator_id']  ?>">

						<img alt="" src="images/trans.gif" border="0" height="8" width="120"><br>
						&nbsp; 

					  <span style="text-transform: uppercase"><?= $row['coordinator_name']?></span></a></div>

					</td>

				</tr>
				<tr><td height="20px"></td></tr>				

				<tr>

					<td colspan="2">

					<img alt="" src="images/trans.gif" border="0" height="2" width="1"></td>

				</tr>			
				
				<?			}//for
		}//if
		

		?>

				
				

			</table>
					 
					  </div>

				  </td>

					<td width="11"></td>
					<td align="center">We will record carefully.</td>

				  
				  
				</tr>

		  </table>
		  
	  </td>

	</tr>

	<tr>

		<td>&nbsp;</td>

	</tr>

</table>


</body>



</html>